package com.oocl.dojo.gildedrose.strategy;

import com.oocl.dojo.gildedrose.model.Item;

public class BackStagePassesStrategy extends Strategy {

    @Override
    protected void updateItemQuality(Item item) {
        if (item.getSellIn() > 10) {
            item.setQuality(item.getQuality() + 1);
            return;
        }

        if (item.getSellIn() > 5 && item.getSellIn() <= 10) {
            item.setQuality(item.getQuality() + 2);
            return;
        }

        if (item.getSellIn() >= 0 && item.getSellIn() <= 5) {
            item.setQuality(item.getQuality() + 3);
            return;
        }

        if (item.getSellIn() < 0) {
            item.setQuality(0);
            return;
        }
    }
}
